#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Niklas Hauser
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------

def init(module):
    module.name = ":communication:xpcc:generator"
    module.description = "XPCC Generator"

def prepare(module, options):
    module.add_option(
        PathOption(name="source", default="", empty_ok=True, absolute=True,
                   description="Path to the XPCC source file"))
    module.add_option(
        StringOption(name="container", default="",
                     description="Name of the XPCC container to generate for"))
    module.add_option(
        PathOption(name="path", default="generated/xpcc", absolute=True,
                   description="Path to the XPCC generated folder"))
    module.add_option(
        StringOption(name="namespace", default="robot",
                     description="Namespace of the generated XPCC communications"))

    return True

def build(env):
    env.outbasepath = "modm/tools/xpcc_generator"
    env.copy(".")
